package org.smile.db.dao;

import java.util.List;

import org.smile.db.dao.impl.BaseVo;

public interface IBaseDAO<E>
{
	/**
	 * ��ѯ���е����
	 * @param c
	 * @return
	 * @throws Exception
	 */
	public List<E> queryAll(Class<E> c) throws Exception;
	/**
	 * ��ѯ
	 * @param c
	 * @param whereSql��where����Ӿ�
	 * @return
	 * @throws Exception 
	 */
	public List<E> query(Class<E> c,String whereSql,Object ... params) throws Exception;
	/**
	 * ��ID��ѯ
	 * @param c
	 * @param id
	 * @return 
	 * @throws Exception 
	 */
	public E queryById(Class<E> c ,Object id) throws Exception;
	/**
	 * ɾ��
	 * @param c
	 * @param id������ID
	 * @throws Exception
	 */
    public void deleteById(Class<E> c,Object id) throws Exception;
    /**
     * ɾ����Ϣ
     * @param c
     * @param sqlWhere��һ��where�־�
     * @throws Exception
     */
    public void delete(Class<E> c,String sqlWhere,Object ... params ) throws Exception;
    /**
     * ɾ����
     * @param c
     * @throws Exception
     */
    public void deleteAll(Class<E> c) throws Exception;
    /**
     * ���һ�������ݿ���
     * @param e
     * @throws Exception
     */
    public void add(E e) throws Exception;
    /**
     * ���һ��ϵ���ݿ���
     * @param c
     * @throws Exception
     */
    public void add(List<E> c) throws Exception;
    /**
     * �޸�
     * @param e
     * @throws Exception
     */
    public void update(E e,String ... fieldname) throws Exception;
}
